<?php

include_once 'Statement.php';
include_once 'StatementCollection.php';

class IterationStatement extends Statement
{
    public function __construct(StatementCollection $Statements = null)
    {
        parent::__construct();
        
        is_null($Statements) ?
            $this->Statements = new StatementCollection() :
            $this->set_Statements($Statements);
    }
    
    public function __set($name, $value)
    {
        parent::__set($name, $value);
        
        if($name == 'Statements')
        {
            $this->set_Statements($value);
        }
    }
    
    public function __get($name)
    {
        $ret = parent::__get($name);
        
        if($ret != null)
        {
            return $ret;
        }
        
        if($name == 'Statements')
        {
            return $this->get_Statements();
        }
    }
    
    public function get_Statements()
    {
        return $this->Statements;
    }

    public function set_Statements(StatementCollection $Statements)
    {
        $this->Statements = $Statements;
    }

    private $Statements;
}

?>
